<script setup>
import {ref,onMounted} from "vue"

const inputRef = ref()
onMounted(() => {
    console.log(inputRef);
    inputRef.value && inputRef.value.focus() // 聚焦
})
</script>

<template>
<input ref="inputRef">
</template>

